//
//  UIButton+addIndex.m
//  honglaba
//
//  Created by 红喇叭 on 2017/6/14.
//  Copyright © 2017年 红喇叭. All rights reserved.
//

#import "UIButton+addIndex.h"


#import "objc/runtime.h"

static const void * OrderTagsBy = &OrderTagsBy;

@implementation UIButton (addIndex)

- (void)setIndex:(NSIndexPath *)index{
    objc_setAssociatedObject(self, OrderTagsBy, index, OBJC_ASSOCIATION_COPY_NONATOMIC);
}


- (NSIndexPath *)index{
    return objc_getAssociatedObject(self, OrderTagsBy);
}

@end

static const void * TextTagsBy = &TextTagsBy;
@implementation UITextField(addIndex)

- (void)setIndex:(NSIndexPath *)index{
    objc_setAssociatedObject(self, TextTagsBy, index, OBJC_ASSOCIATION_COPY_NONATOMIC);
}

- (NSIndexPath *)index{
    return objc_getAssociatedObject(self, TextTagsBy);
}
@end

